package com.codeczx.mysimpletagimageview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.youth.banner.Banner;

import java.util.ArrayList;
import java.util.List;

public class BannerAcitivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_banner_acitivity);
        Banner banner = (Banner) findViewById(R.id.banner);
        //设置图片加载器
        banner.setImageLoader(new GlideImageLoader());
        //设置图片集合
        List<String> list = new ArrayList<>();
        list.add("http://www.onepiece.cc/templets/default/images/title-index.png");
        list.add("http://www.onepiece.cc/templets/default/images/title-index.png");
        list.add("http://www.onepiece.cc/templets/default/images/title-index.png");
        banner.setImages(list);
        //banner设置方法全部调用完毕时最后调用
        banner.start();
    }
}
